
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:wanxiang_app/pages/my/readStep1.dart';
import 'package:wanxiang_app/utils/common.dart';
import 'package:wanxiang_app/utils/constant.dart';
import '../../utils/user_util.dart';
import '../../widgets/myappbar.dart';
import 'package:get/get.dart';
class RealNamePage2 extends StatefulWidget {
  @override
  _HomeState createState() => _HomeState();
}
class _HomeState extends State<RealNamePage2> {

  @override
  void initState() {
    super.initState();

  }

  @override
  Widget build(BuildContext context) {
    return
      Scaffold(
        backgroundColor: Colors.white,
        appBar: MyAppBar(context: context, title: '实名认证',),
        body: _content(),
      );
  }
  Widget _content(){
    return Container(
      margin: EdgeInsets.only(left: 16.w,right: 16.w,top: 10.h),
      child: Column(
        children: [
          _top(),
          SizedBox(height: 27.h,),
          _name(),
          SizedBox(height: 17.h,),
          _item('身份信息','填写姓名及身份证号'),
          // SizedBox(height: 8.h,),
          // _item('人脸认证','精准识别，安全方便'),
        ],
      ),
    );
  }

  Widget _item(name,desc){
    return InkWell(
      onTap: (){
        if(name=='身份信息'){
          // Get.to(()=>RealStep1Page());
        }
      },
      child: Container(
        padding: EdgeInsets.only(left: 18.w,right: 14.w),
        height: 89.h,
        decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(10.r),
            color: Colors.white,
            boxShadow:const [
              BoxShadow(
                  color: Color(0x0D000000),
                  offset: Offset(1, 1),
                  blurRadius:1,
                  spreadRadius:0.5
              ),
              BoxShadow(
                  color: Color(0x0D000000),
                  offset: Offset(-1, -1),
                  blurRadius:1,
                  spreadRadius:0.5
              ),
            ]
        ),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Text(name,style: TextStyle(
                    color: Color(0xFF333333),
                    fontSize: 15.sp,
                    fontWeight: FontWeight.bold
                ),),
                SizedBox(height: 10.h,),
                Text(desc,style: TextStyle(
                    color: Color(0xFF666666),
                    fontSize: 13.sp,
                    fontWeight: FontWeight.bold
                ),),
              ],
            ),
            Container(
              width: 68.w,
              height: 38.h,
              alignment: Alignment.center,
              decoration: BoxDecoration(
                  color: Color(0xFFFEEBED),
                  borderRadius: BorderRadius.circular(19.r)
              ),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  Image.asset(Constant.IMG_BASE+'real_done.png',width: 14.w,height: 14.h,),
                  SizedBox(width: 6.w,),
                  Text('完成',style: TextStyle(
                      color: Color(0xFFEF3D4E),
                      fontSize: 12.sp
                  ),)
                ],
              ),
            )

          ],
        ),
      )
    ) ;
  }

  Widget _name(){
    return Row(
      children: [
        Text('实名认证',style: TextStyle(
            color: Color(0xFF333333),
            fontSize: 15.sp,
            fontWeight: FontWeight.bold
        ))
      ],
    ) ;
}

  Widget _top(){
    return Container(
      padding: EdgeInsets.only(left: 25.w,top: 32.h,right: 31.w,bottom: 23.h),
      height: 104.h,
      decoration:  BoxDecoration(
        borderRadius: BorderRadius.circular(10.r),
          gradient: const LinearGradient(      //渐变位置
              begin: Alignment.centerLeft, //右上
              end: Alignment.centerRight, //左下
              //渐变颜色[始点颜色, 结束颜色]
              colors: [Color(0xFFF5AA71), Color(0xFFF75352)]
          )
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Text('已认证',style: TextStyle(
                color: Colors.white,
                fontSize: 17.sp,
                fontWeight: FontWeight.bold
              ),),
              SizedBox(height: 11.h,),
              Text(Common.transferDate(UserUtil.getUSER()!.realTime) ,style: TextStyle(
                  color: Colors.white,
                  fontSize: 14.sp,
              ),),
            ],
          ),
          Container(
            width: 74.w,
            height: 74.h,
            alignment: Alignment.center,
            decoration: BoxDecoration(
              shape: BoxShape.circle,
              border: Border.all(width: 4.w,color: Colors.white)
            ),
            child: Text('100%' ,style: TextStyle(
              color: Colors.white
            ),),
          )
        ],
      ),
    );
  }
}